package com.ecoolex.discount.sales.ws;

import com.ecoolex.discount.sales.entity.CardVoucherPackage;
import com.ecoolex.discount.sales.entity.DiscountOrder;
import com.ecoolex.discount.sales.entity.DiscountOrderDetail;
import com.ecoolex.discount.sales.entity.DiscountOrderRefund;
import com.ecoolex.discount.sales.entity.YouWorldGiftCardOrder;
import com.ecoolex.discount.sales.pojo.CreateOrderChannelDTO;
import com.ecoolex.discount.sales.pojo.QueryDiscountOrderDTO;
import com.ecoolex.discount.sales.pojo.QueryUserDiscountOrderDTO;
import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;

import java.math.BigDecimal;
import java.util.List;

public interface DiscountOrderService {
    DiscountOrder createQuotaGiftCardOrder(Integer userId, Integer productId, CreateOrderChannelDTO channel,String createUser) throws BizException;

    DiscountOrder createGiftCardOrder(Integer userId, Integer productId, BigDecimal faceValue,CreateOrderChannelDTO channel, String createUser) throws BizException;

    DiscountOrder createVouchersOrder(Integer userId, Integer productId, Integer buyNumber,CreateOrderChannelDTO channel, String createUser) throws BizException;

    boolean cancelOrder(Integer userId, Integer orderId, String updateUser) throws BizException;

    boolean deleteOrder(Integer userId, Integer orderId, String updateUser) throws BizException;

    boolean confirmCompleteOrder(Integer userId, Integer orderId, String updateUser) throws BizException;
    
    boolean confirmPartCompleteOrder(Integer userId, Integer orderId, String updateUser) throws BizException;

    Boolean refund(DiscountOrder order,Boolean cardUsed,String reasonType,String reasonComments,Boolean useBindPhone,String contactPhone, String updateUser) throws BizException;

    Boolean cancelRefund(DiscountOrder order, String updateUser) throws BizException;
    
    DiscountOrder getOrderById(Integer userId, Integer orderId);

    DiscountOrder getOrderById(Integer orderId);

    Pagination<DiscountOrder> queryOrderByUserId(Integer userId, QueryUserDiscountOrderDTO query, Sorting[] sorts, Page page);

    Pagination<DiscountOrder> query(QueryDiscountOrderDTO query, Sorting[] sorts, Page page);

    List<DiscountOrderDetail> queryOrderDetailByOrderId(Integer orderId);

    Pagination<CardVoucherPackage> queryCardVoucherPackage(Integer userId,Page page, Integer discountMode);
    
    CardVoucherPackage getCardVoucherPackage(Integer cardVoucherId,Integer userId);
    
    YouWorldGiftCardOrder getByOrderId(String orderId);
    
    DiscountOrderRefund getByOrderId(Integer orderId);
}
